// const app = getApp()
const KeyWord = 'token'
const r_KeyWord = 'r_token'

const store = {

  user: wx.getStorageSync(KeyWord) || {},
  r_user: wx.getStorageSync(r_KeyWord) || {},
  setUser: function (token, refresh_token) {
    this.user = token
    wx.setStorageSync(KeyWord, token)
    wx.setStorageSync(r_KeyWord, refresh_token)
    // app.globalDate.isLogin = true

  },

  clearUser: function () {
    this.user = {}
    wx.removeStorage(KeyWord)
    wx.removeStorage(r_KeyWord)
    // app.globalDate.isLogin = false

  }
}
export { store } 
